#ifndef __cbuffer__
#define __cbuffer__

#include "celement.h"
class CElement;

class CEvent;
class CPart;

class CBuffer : public CElement {
protected:
	std::vector<CPart*> Content;
	int Capacity;
	int NowIn;
	bool isEmpty;
	bool isFull;
public:
	bool IsEmpty();
	bool IsFull();
	void Respond(CEvent* evt);
	bool GetAPartIn(CPart* part);
	CPart* GiveAPartOut();//先进先出
	CBuffer();
	~CBuffer();
	void setCapacity(int cp);
	void showContent();
	double showDeltaTd(bool show_on_screen=true);//选定该缓冲作为最后一个缓冲，并打印ΔTd
	
	double showW_sigma(double start_time,double end_time,double alpha, double beta,bool show_on_screen=true);
	//show the weighted sum of earliness and tardiness accord to a common due window

};
#endif // __cbuffer__
